<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="Hexo">
  <link 
    rel="icon" 
    href="https://demo.theme-kaze.top/img/Kaze.png">
  <title>centos7搭建博客</title>
  
    
      <meta 
        property="og:title" 
        content="centos7搭建博客">
    
    
      <meta 
        property="og:url" 
        content="https://laoma.gitee.io/fungloengblog/2021/12/21/centos7%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://demo.theme-kaze.top/img/Kaze.png">
    
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2021-12-21">
      <meta 
        property="og:article:modified_time" 
        content="2021-12-21">
      <meta 
        property="og:article:author" 
        content="IAMFUNGLOENG">
      
        
      
    
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
      }
    };
    setDarkmode();
    </script>
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  
    <link rel="preload" href="/fungloengblog/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/fungloengblog/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/fungloengblog/js/lib/lozad.min.js" as="script">
  
  
  
  
  
  
  
  <link rel="stylesheet" href="/fungloengblog/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
    <link rel="stylesheet" href="/fungloengblog/js/lib/lightbox/baguetteBox.min.css">
  
<meta name="generator" content="Hexo 5.4.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
        <img 
          class="navbar-logo-img"
          width="32"
          height="32"
          src="https://demo.theme-kaze.top/img/Kaze.png" 
          alt="blog logo">
      
      <span class="navbar-logo-dsc">FUNGLOENG</span>
    </span>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/fungloengblog/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/fungloengblog/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/fungloengblog/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/fungloengblog/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/fungloengblog/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
      <a 
        href="/fungloengblog/links" 
        class="navbar-menu-item">
        
          友链
        
      </a>
    
    <a 
      class="navbar-menu-item darknavbar" 
      id="dark">
      <i class="iconfont icon-weather"></i>
    </a>
    <a 
      class="navbar-menu-item searchnavbar" 
      id="search">
      <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i>
    </a>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      centos7搭建博客
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-12-21T13:21:07.000Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2021-12-21</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/fungloengblog/categories/hexo/" 
          class="post-meta-link">
          hexo
        </a>
      
    
    
      <span class="dot"></span>
      <span>5k 字</span>
    
  </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <h2 id="Hexo-安装"><a href="#Hexo-安装" class="headerlink" title="Hexo 安装"></a>Hexo 安装</h2><h3 id="前置要求"><a href="#前置要求" class="headerlink" title="前置要求"></a>前置要求</h3><ul>
<li>Node.js（版本 10.13 以上，建议使用 12.0 以上版本）</li>
<li>Git</li>
</ul>
<h3 id="安装-Git"><a href="#安装-Git" class="headerlink" title="安装 Git"></a>安装 Git</h3><ul>
<li>Windows：下载并安装 <strong>git</strong>[2]。</li>
<li>Mac：使用 <strong>Homebrew</strong>[3] 安装。</li>
<li>Linux（Ubuntu，Debian）：<code>sudo apt-get install git-core</code></li>
<li>Linux（Fedora，Red Hat，CentOS）：<code>sudo yum install git-core</code></li>
</ul>
<h3 id="安装-Node-js"><a href="#安装-Node-js" class="headerlink" title="安装 Node.js"></a>安装 Node.js</h3><p>Node.js为大多数平台提供了 <strong>官方安装程序</strong>[4]。</p>
<ul>
<li><p>该方法安装的node的版本很旧</p>
<pre class="highlight"><span class="line">sudo yum install nodejs</span><br></pre></li>
<li><p>到官网下载源码编译</p>
<pre class="highlight"><span class="line"><span class="meta">#</span><span class="bash">下载包</span></span><br><span class="line">wget https://nodejs.org/dist/v16.13.1/node-v16.13.1.tar.gz</span><br><span class="line"><span class="meta">#</span><span class="bash">解压</span></span><br><span class="line">tar zxvf node-v16.13.1.tar.gz</span><br><span class="line"><span class="meta">#</span><span class="bash">进入目录</span></span><br><span class="line">cd node-v16.13.1</span><br><span class="line"><span class="meta">#</span><span class="bash">配置</span></span><br><span class="line">./configure </span><br><span class="line"><span class="meta">#</span><span class="bash">编译</span></span><br><span class="line">make </span><br><span class="line"><span class="meta">#</span><span class="bash">安装</span></span><br><span class="line">sudo make install</span><br></pre></li>
<li><p>到官网下载二进制文件</p>
<ul>
<li><p>Node.js 安装包及源码下载地址为：<a target="_blank" rel="noopener" href="https://nodejs.org/en/download/%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E6%A0%B9%E6%8D%AE%E4%B8%8D%E5%90%8C%E5%B9%B3%E5%8F%B0%E7%B3%BB%E7%BB%9F%E9%80%89%E6%8B%A9%E4%BD%A0%E9%9C%80%E8%A6%81%E7%9A%84">https://nodejs.org/en/download/，你可以根据不同平台系统选择你需要的</a> Node.js 安装包，这里选择的是 <a target="_blank" rel="noopener" href="https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz">Linux Binaries (x64)</a>。</p>
</li>
<li><p>安装</p>
<pre class="highlight"><span class="line">wget https://nodejs.org/dist/v16.13.1/node-v16.13.1-linux-x64.tar.xz</span><br><span class="line">tar xf node-v16.13.1-linux-x64.tar.xz</span><br><span class="line">mv node-v16.13.1-linux-x64 /usr/local/</span><br><span class="line">mv node-v16.13.1-linux-x64/ node</span><br></pre></li>
<li><p>修改linux系统的环境变量（profile）来设置直接运行命令</p>
<pre class="highlight"><span class="line">cp /etc/profile /etc/profile.bak</span><br><span class="line">vim /etc/profile</span><br><span class="line">#在最下面添加 export PATH=$PATH: 后面跟上node下bin目录的路径</span><br><span class="line">export PATH=$PATH:/usr/local/node/bin</span><br><span class="line">#立即生效</span><br><span class="line">source /etc/profile</span><br><span class="line">#任意目录查看 </span><br><span class="line">node -v</span><br><span class="line">v16.13.1</span><br></pre></li>
</ul>
</li>
</ul>
<p>替代安装方法：</p>
<ul>
<li>Windows：使用 <strong>nvs</strong>[5] 安装它。</li>
<li>Mac：使用 <strong>Homebrew</strong>[6] 安装。</li>
<li>Linux（基于 DEB / RPM）：与 <strong>NodeSource</strong>[7] 一起安装。</li>
<li>其他：通过相应的软件包管理器进行安装。请参阅 Node.js 提供的<strong>指南</strong>[8]。</li>
</ul>
<h3 id="安装-Hexo"><a href="#安装-Hexo" class="headerlink" title="安装 Hexo"></a>安装 Hexo</h3><p>用 npm 安装 Hexo。</p>
<pre class="highlight"><span class="line">npm install -g hexo-cli</span><br></pre>



<p>使用以下指令查看是否安装成功。</p>
<pre class="highlight"><span class="line">hexo version</span><br></pre>



<p>如果你想卸载 Hexo，使用以下指令：</p>
<pre class="highlight"><span class="line">npm uninstall -g hexo-cli</span><br></pre>

<h3 id="运行-hexo"><a href="#运行-hexo" class="headerlink" title="运行 hexo"></a>运行 hexo</h3><p>安装后，你可以通过 <code>hexo &lt;command&gt;</code> 运行 Hexo。比如通过 <code>hexo help</code> 指令来获取使用帮助。</p>
<pre class="highlight"><span class="line">hexo help</span><br></pre>

<p>帮助里提到 <code>hexo init</code> 命令可以创建一个新的 Hexo 文件夹，这个文件夹其实就是利用 Hexo 生成的站点信息了。接下来讲下怎么建站。</p>
<h2 id="Hexo-建站"><a href="#Hexo-建站" class="headerlink" title="Hexo 建站"></a>Hexo 建站</h2><h3 id="初始化操作"><a href="#初始化操作" class="headerlink" title="初始化操作"></a>初始化操作</h3><p>使用 <code>hexo init &lt;folder&gt;</code> 指令就可以在指定文件夹下建立站点信息：</p>
<pre class="highlight"><span class="line">hexo init fungloengblog</span><br></pre>

<p>站点初始化中：</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002050937.png" alt="image-20211219002050937" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002050937.png" class="lozad post-image"></p>
<p>站点初始化完成，会生成指定的文件夹：</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002130847.png" alt="image-20211219002130847" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002130847.png" class="lozad post-image"></p>
<h3 id="目录结构"><a href="#目录结构" class="headerlink" title="目录结构"></a>目录结构</h3><p>进入该站点，我们看下目录结构，如下：</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002155157.png" alt="image-20211219002155157" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219002155157.png" class="lozad post-image"></p>
<p>这些文件有着各自的职责：</p>
<ul>
<li>_config.landscape.yml：自定义的主题配置文件，此处的 landscape 是默认主题。配置其他主题可以参考这种方式。</li>
<li>_config.yml：站点全局的配置文件。</li>
<li>node_modules：node 模块文件夹。包含可执行文件和依赖的资源。</li>
<li>package-lock.json：node_modules 文件中所有模块的版本信息，模块来源。</li>
<li>package.json：Hexo 框架的基本参数信息以及它所依赖的插件。</li>
<li>scaffolds：scaffolds 原意是脚手架，这里可以理解为模板文件夹。当你创建新的文章时，Hexo 会根据该文件夹下的对应文件进行初始化构建。</li>
<li>source：资源文件夹。这里是你放自己资源比如博文和图片的地方。<code>_posts</code> 文件夹下的 Markdown 和 HTML 文件会被解析并放到 <code>public</code> 文件夹下。其他文件或文件夹，如果开头命名不是 <code>_</code> (下划线)，也都会被拷贝过去。</li>
<li>themes：主题文件夹。Hexo 会根据主题来生成静态页面。</li>
</ul>
<p>基于这样的结构，Hexo 就具备了生成静态网站的能力。</p>
<h3 id="本地启动"><a href="#本地启动" class="headerlink" title="本地启动"></a>本地启动</h3><p>我们先本地启动，看下实际效果。输入以下命令：</p>
<pre class="highlight"><span class="line">hexo server</span><br><span class="line"></span><br><span class="line">sudo firewall-cmd --add-port=4000/tcp --permanent</span><br><span class="line">sudo firewall-cmd --reload</span><br><span class="line">firewall-cmd --list-all</span><br><span class="line"></span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHOFmWeTpibITicM0O8h0IUXP20LzmJwPHy16ibJZ0jbrfGTby3JgjgJrYg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHOFmWeTpibITicM0O8h0IUXP20LzmJwPHy16ibJZ0jbrfGTby3JgjgJrYg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>Hexo 会启动服务，将默认生成的网站运行在本机的 4000 端口上，可以直接访问 <code>http://localhost:4000</code> 就能看到网站首页，它基于默认主题生成，同时有一篇默认文章。</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219114148524.png" alt="image-20211219114148524" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211219114148524.png" class="lozad post-image"></p>
<p>这个页面只是官方提供的一个样例，看到它就意味着你本地环境跑通了。我们可以通过修改配置的方式，对页面相关元素做调整。</p>
<h3 id="核心配置"><a href="#核心配置" class="headerlink" title="核心配置"></a>核心配置</h3><p>以下是我们需要了解或者修改的配置信息。</p>
<h4 id="package-json"><a href="#package-json" class="headerlink" title="package.json"></a>package.json</h4><p>这个文件列出了 Hexo 的基本参数信息以及它所依赖的插件。可以看到，<strong>EJS</strong>[9]，<strong>Stylus</strong>[10] 和 <strong>Markdown</strong>[11] 渲染器都是默认安装的。</p>
<pre class="highlight"><span class="line">&#123;</span><br><span class="line">  <span class="attr">&quot;name&quot;</span>: <span class="string">&quot;hexo-site&quot;</span>,</span><br><span class="line">  <span class="attr">&quot;version&quot;</span>: <span class="string">&quot;0.0.0&quot;</span>,</span><br><span class="line">  <span class="attr">&quot;private&quot;</span>: <span class="literal">true</span>,</span><br><span class="line">  <span class="attr">&quot;scripts&quot;</span>: &#123;</span><br><span class="line">    <span class="attr">&quot;build&quot;</span>: <span class="string">&quot;hexo generate&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;clean&quot;</span>: <span class="string">&quot;hexo clean&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;deploy&quot;</span>: <span class="string">&quot;hexo deploy&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;server&quot;</span>: <span class="string">&quot;hexo server&quot;</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="attr">&quot;hexo&quot;</span>: &#123;</span><br><span class="line">    <span class="attr">&quot;version&quot;</span>: <span class="string">&quot;&quot;</span></span><br><span class="line">  &#125;,</span><br><span class="line">  <span class="attr">&quot;dependencies&quot;</span>: &#123;</span><br><span class="line">    <span class="attr">&quot;hexo&quot;</span>: <span class="string">&quot;^5.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-generator-archive&quot;</span>: <span class="string">&quot;^1.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-generator-category&quot;</span>: <span class="string">&quot;^1.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-generator-index&quot;</span>: <span class="string">&quot;^2.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-generator-tag&quot;</span>: <span class="string">&quot;^1.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-renderer-ejs&quot;</span>: <span class="string">&quot;^1.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-renderer-marked&quot;</span>: <span class="string">&quot;^3.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-renderer-stylus&quot;</span>: <span class="string">&quot;^2.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-server&quot;</span>: <span class="string">&quot;^2.0.0&quot;</span>,</span><br><span class="line">    <span class="attr">&quot;hexo-theme-landscape&quot;</span>: <span class="string">&quot;^0.0.3&quot;</span></span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre>

<blockquote>
<p>如果后边要切换主题，记得把最后一个默认的主题依赖删除掉。</p>
</blockquote>
<h4 id="config-yml"><a href="#config-yml" class="headerlink" title="_config.yml"></a>_config.yml</h4><p>可设置网站、网址、目录、文章、分类&amp;标签、日期/时间格式、分页和扩展等信息。</p>
<h5 id="网站"><a href="#网站" class="headerlink" title="网站"></a>网站</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHd0vDeiaiahza3V7wREzwJpBtclTp8JTup36R82a7BabhxA2Bex4SgqJQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="" alt="图片" srcset="" class="lozad post-image"></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>url</code></td>
<td align="left">网址, must starts with <code>http://</code> or <code>https://</code></td>
<td align="left"><a target="_blank" rel="noopener" href="http://example.com/">http://example.com</a></td>
</tr>
<tr>
<td align="left"><code>root</code></td>
<td align="left">网站根目录，如果放子目录，设置 <code>/blog/</code></td>
<td align="left">/</td>
</tr>
<tr>
<td align="left"><code>permalink</code></td>
<td align="left">文章的 <strong>永久链接</strong>[13] 格式</td>
<td align="left"><code>:year/:month/:day/:title/</code></td>
</tr>
<tr>
<td align="left"><code>permalink_defaults</code></td>
<td align="left">永久链接中各部分的默认值</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>pretty_urls</code></td>
<td align="left">改写 <strong><code>permalink</code></strong>[14] 的值来美化 URL</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>pretty_urls.trailing_index</code></td>
<td align="left">是否在永久链接中保留尾部的 <code>index.html</code>，设置为 <code>false</code> 时去除</td>
<td align="left"><code>true</code></td>
</tr>
<tr>
<td align="left"><code>pretty_urls.trailing_html</code></td>
<td align="left">是否在永久链接中保留尾部的 <code>.html</code>, 设置为 <code>false</code> 时去除 (<em>对尾部的 <code>index.html</code>无效</em>)</td>
<td align="left"><code>true</code></td>
</tr>
</tbody></table>
<h5 id="目录"><a href="#目录" class="headerlink" title="目录"></a>目录</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHs6RJXKCBK1LgMKnIxSqL1h1icLXe9y8BicXu2YLFMHQgC2v1NGI1Lm1Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="" alt="图片" srcset="" class="lozad post-image"></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>new_post_name</code></td>
<td align="left">新文章的文件名称</td>
<td align="left">:title.md</td>
</tr>
<tr>
<td align="left"><code>default_layout</code></td>
<td align="left">预设布局</td>
<td align="left">post</td>
</tr>
<tr>
<td align="left"><code>auto_spacing</code></td>
<td align="left">在中文和英文之间加入空格</td>
<td align="left">false</td>
</tr>
<tr>
<td align="left"><code>titlecase</code></td>
<td align="left">把标题转换为 title case</td>
<td align="left">false</td>
</tr>
<tr>
<td align="left"><code>external_link</code></td>
<td align="left">在新标签中打开链接</td>
<td align="left">true</td>
</tr>
<tr>
<td align="left"><code>external_link.enable</code></td>
<td align="left">在新标签中打开链接</td>
<td align="left"><code>true</code></td>
</tr>
<tr>
<td align="left"><code>external_link.field</code></td>
<td align="left">对整个网站（<code>site</code>）生效或仅对文章（<code>post</code>）生效</td>
<td align="left"><code>site</code></td>
</tr>
<tr>
<td align="left"><code>external_link.exclude</code></td>
<td align="left">需要排除的域名。主域名和子域名如 <code>www</code> 需分别配置</td>
<td align="left"><code>[]</code></td>
</tr>
<tr>
<td align="left"><code>filename_case</code></td>
<td align="left">把文件名称转换为 (1) 小写或 (2) 大写</td>
<td align="left">0</td>
</tr>
<tr>
<td align="left"><code>render_drafts</code></td>
<td align="left">显示草稿</td>
<td align="left">false</td>
</tr>
<tr>
<td align="left"><code>post_asset_folder</code></td>
<td align="left">启动 <strong>Asset 文件夹</strong>[15]</td>
<td align="left">false</td>
</tr>
<tr>
<td align="left"><code>relative_link</code></td>
<td align="left">把链接改为与根目录的相对地址，建议使用绝对地址。</td>
<td align="left">false</td>
</tr>
<tr>
<td align="left"><code>future</code></td>
<td align="left">显示未来的文章</td>
<td align="left">true</td>
</tr>
<tr>
<td align="left"><code>highlight</code></td>
<td align="left">代码块的设置, see <strong>Highlight.js</strong>[16] section for usage guide</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>prismjs</code></td>
<td align="left">代码块的设置, see <strong>PrismJS</strong>[17] section for usage guide</td>
<td align="left"></td>
</tr>
</tbody></table>
<h5 id="分类-amp-标签"><a href="#分类-amp-标签" class="headerlink" title="分类 &amp; 标签"></a>分类 &amp; 标签</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHL7CtYpapoXKtpYFQcdrlbwKuicgDJ6gXF5G196fZCxkS2MEZ9h57LSg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHL7CtYpapoXKtpYFQcdrlbwKuicgDJ6gXF5G196fZCxkS2MEZ9h57LSg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>default_category</code></td>
<td align="left">默认分类</td>
<td align="left"><code>uncategorized</code></td>
</tr>
<tr>
<td align="left"><code>category_map</code></td>
<td align="left">分类别名</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>tag_map</code></td>
<td align="left">标签别名</td>
<td align="left"></td>
</tr>
</tbody></table>
<h5 id="日期-时间格式"><a href="#日期-时间格式" class="headerlink" title="日期/时间格式"></a>日期/时间格式</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibH31jNYr1BUt4CbsIzlZctg2PZRC3vZOvzia4sPFyxg5Q8PlPtx80lUxA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibH31jNYr1BUt4CbsIzlZctg2PZRC3vZOvzia4sPFyxg5Q8PlPtx80lUxA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>Hexo 使用 <strong>Moment.js</strong>[18] 来解析和显示时间。</p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>date_format</code></td>
<td align="left">日期格式</td>
<td align="left"><code>YYYY-MM-DD</code></td>
</tr>
<tr>
<td align="left"><code>time_format</code></td>
<td align="left">时间格式</td>
<td align="left"><code>HH:mm:ss</code></td>
</tr>
<tr>
<td align="left"><code>updated_option</code></td>
<td align="left">当 Front Matter 中没有指定 <strong><code>updated</code></strong>[19] 时 <code>updated</code> 的取值，支持 mtime(文件最后修改时间)，date(使用 date 的值)，empty(不指定)</td>
<td align="left"><code>mtime</code></td>
</tr>
</tbody></table>
<h5 id="分页"><a href="#分页" class="headerlink" title="分页"></a>分页</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHFVicRYQIuAtHPoCfp6xtrxq02jyRYiaEwUuDgE6UPia3eRH8248dMxzkw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHFVicRYQIuAtHPoCfp6xtrxq02jyRYiaEwUuDgE6UPia3eRH8248dMxzkw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>per_page</code></td>
<td align="left">每页显示的文章量 (0 = 关闭分页功能)</td>
<td align="left"><code>10</code></td>
</tr>
<tr>
<td align="left"><code>pagination_dir</code></td>
<td align="left">分页目录</td>
<td align="left"><code>page</code></td>
</tr>
</tbody></table>
<h5 id="扩展"><a href="#扩展" class="headerlink" title="扩展"></a>扩展</h5><p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHXic7jnX71icjE6TE3IZYfOb3qJhrvP9YuC7aiayuhibHRvvH75fQI7AP7Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHXic7jnX71icjE6TE3IZYfOb3qJhrvP9YuC7aiayuhibHRvvH75fQI7AP7Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>【主题】</p>
<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认值</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>theme</code></td>
<td align="left">当前主题名称。值为<code>false</code>时禁用主题</td>
<td align="left">landscape</td>
</tr>
<tr>
<td align="left"><code>theme_config</code></td>
<td align="left">主题的配置文件。在这里放置的配置会覆盖主题目录下的 <code>_config.yml</code> 中的配置</td>
<td align="left">无初始配置</td>
</tr>
<tr>
<td align="left"><code>deploy</code></td>
<td align="left">部署部分的设置</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>meta_generator</code></td>
<td align="left"><strong>Meta generator</strong>[20] 标签。值为 <code>false</code> 时 Hexo 不会在头部插入该标签</td>
<td align="left">true</td>
</tr>
</tbody></table>
<p>【部署】</p>
<p>配置如下：</p>
<pre class="highlight"><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: &lt;repository url&gt; #https://bitbucket.org/JohnSmith/johnsmith.bitbucket.io</span><br><span class="line">  branch: [branch]</span><br><span class="line">  message: [message]</span><br></pre>

<table>
<thead>
<tr>
<th align="left">参数</th>
<th align="left">描述</th>
<th align="left">默认</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>repo</code></td>
<td align="left">库（Repository）地址</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"><code>branch</code></td>
<td align="left">分支名称</td>
<td align="left"><code>gh-pages</code> (GitHub) <code>coding-pages</code> (Coding.net) <code>master</code> (others)</td>
</tr>
<tr>
<td align="left"><code>message</code></td>
<td align="left">自定义提交信息</td>
<td align="left"><code>Site updated: &#123;&#123; now('YYYY-MM-DD HH:mm:ss') &#125;&#125;</code>)</td>
</tr>
<tr>
<td align="left"><code>token</code></td>
<td align="left">Optional token value to authenticate with the repo. Prefix with <code>$</code> to read token from environment variable</td>
<td align="left"></td>
</tr>
</tbody></table>
<h3 id="常用指令"><a href="#常用指令" class="headerlink" title="常用指令"></a>常用指令</h3><h4 id="创建文章"><a href="#创建文章" class="headerlink" title="创建文章"></a>创建文章</h4><p>使用以下指令：</p>
<pre class="highlight"><span class="line">hexo new &quot;test&quot;</span><br></pre>

<p>或者简写：</p>
<pre class="highlight"><span class="line">hexo n &quot;test&quot;</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHJkQibuQP5ibln0gdqSRnYvfyoVib50SONHd2E2Lj3XuzazgzW6PAwut2A/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="" alt="图片" srcset="" class="lozad post-image"></p>
<p>安装成功后，会生出目录：hexo-theme-Kaze。</p>
<p>修改站点配置文件 <code>_config.yml</code> 下的主题值为：hexo-theme-Kaze。</p>
<p><img src="" alt="图片" srcset="" class="lozad post-image"></p>
<p>用 <code>hexo server</code> 启动 Hexo 服务看下效果。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHIia042bVu7LqJfib9etpzrvxncEtCiap467NDF9IibWPMOSdo04d7t5g4w/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHIia042bVu7LqJfib9etpzrvxncEtCiap467NDF9IibWPMOSdo04d7t5g4w/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>会看到已经生成了默认的主题，只是很多东西都没有，需要改造一下。</p>
<h3 id="主题配置"><a href="#主题配置" class="headerlink" title="主题配置"></a>主题配置</h3><p>可在该主题目录下的 <strong>_config.yml</strong> 文件里配置。</p>
<h4 id="主题颜色"><a href="#主题颜色" class="headerlink" title="主题颜色"></a>主题颜色</h4><p>在 <strong>color</strong> 中进行配置，以下是默认值。</p>
<pre class="highlight"><span class="line">color:</span><br><span class="line">  text-color: &quot;#3c4858&quot;</span><br><span class="line">  text-strong-color: &quot;#2f3d4e&quot;</span><br><span class="line">  text-light-color: &quot;#909faf&quot;</span><br><span class="line">  divider-color: &quot;#e6e8ee&quot;</span><br><span class="line">  title-color: &quot;#475b6d&quot;</span><br><span class="line">  link-color: &quot;#3273dc&quot;</span><br><span class="line">  link-hover-color: &quot;#6596e5&quot;</span><br><span class="line">  info-text-color: &quot;#909faf&quot;</span><br><span class="line">  widget-background-color: &quot;#fff&quot;</span><br><span class="line">  body-background-color: &quot;#f2f5f8&quot;</span><br><span class="line">  border-color: &quot;#e1e4e9&quot;</span><br><span class="line">  pre-color: &quot;#2d2d2d&quot;</span><br><span class="line">  code-color: &quot;#50687c&quot;</span><br><span class="line">  code-background-color: &quot;#e9eaf0&quot;</span><br></pre>

<h4 id="字号与字体"><a href="#字号与字体" class="headerlink" title="字号与字体"></a>字号与字体</h4><p>在 <strong>font</strong> 中进行配置，以下是默认值。</p>
<pre class="highlight"><span class="line">font:</span><br><span class="line">  font-size: 16px # global font-size</span><br><span class="line">  font-family: &#x27;-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,&quot;Helvetica Neue&quot;,&quot;PingFang SC&quot;,&quot;Microsoft YaHei&quot;,sans-serif&#x27; # global font-family</span><br></pre>

<h4 id="站点访问量统计"><a href="#站点访问量统计" class="headerlink" title="站点访问量统计"></a>站点访问量统计</h4><p>访问量统计目前仅支持不蒜子，默认关闭，可统计站点总访问量和总访客数。</p>
<pre class="highlight"><span class="line">footer:</span><br><span class="line">  #------------------------</span><br><span class="line">  # pv / uv statistics config</span><br><span class="line">  #------------------------</span><br><span class="line">  statistics:</span><br><span class="line">    enable: false</span><br><span class="line">    type: busuanzi # now version only supports busuanzi</span><br><span class="line">    pv:</span><br><span class="line">      enable: true</span><br><span class="line">      style: 本站总访问量&#123;&#125;次 # the style will be shown as $1&#123;pv&#125;$2</span><br><span class="line">    uv:</span><br><span class="line">      enable: true</span><br><span class="line">      style: 本站总访客数&#123;&#125;次 # the style will be shown as $1&#123;uv&#125;$2</span><br></pre>

<h4 id="数据分析"><a href="#数据分析" class="headerlink" title="数据分析"></a>数据分析</h4><pre class="highlight"><span class="line">analytics:</span><br><span class="line">  enable: false</span><br><span class="line">  type: google # google</span><br><span class="line">  google:</span><br><span class="line">    id:</span><br></pre>

<p><code>enable</code> 开启分析支持（默认关闭）</p>
<p>type 目前仅支持 google</p>
<p><code>google.id</code> 有关谷歌分析的具体使用说明和 <code>id</code> 使用可以参考<strong>谷歌文档</strong>[22]</p>
<h4 id="首页"><a href="#首页" class="headerlink" title="首页"></a>首页</h4><h5 id="文章头图"><a href="#文章头图" class="headerlink" title="文章头图"></a>文章头图</h5><p>在文章 <code>Front-matter</code> 中 <code>banner_img</code> 可以设置首页头图</p>
<h5 id="小组件"><a href="#小组件" class="headerlink" title="小组件"></a>小组件</h5><pre class="highlight"><span class="line">widgets:</span><br><span class="line">  showWidgetsMobiles: &quot;none&quot;</span><br></pre>

<p><code>showWidgetsMobiles</code> : 在窄屏幕上是否显示小组件，<code>none</code> 关闭（默认），<code>flex</code> 开启</p>
<h4 id="关于"><a href="#关于" class="headerlink" title="关于"></a>关于</h4><p>关于页面需要自行创建，在站点 <code>source</code> 中新建 <code>about</code> 文件夹并在文件夹内创建 <code>index.md</code>，该文件至少需要包含</p>
<pre class="highlight"><span class="line"># at $&#123;yoursite&#125;/about/index.md</span><br><span class="line">---</span><br><span class="line">title: 关于</span><br><span class="line">layout: about</span><br><span class="line">---</span><br></pre>

<h5 id="社交链接"><a href="#社交链接" class="headerlink" title="社交链接"></a>社交链接</h5><p>在 about 下的 <code>social_links</code>中进行配置，主题图标依赖于 <strong>iconfont</strong>[23]，Hexo 内置了一部分社交图标，你可以自定义其他 icon 文件或者解决方案来添加自定义图标。</p>
<pre class="highlight"><span class="line">about:</span><br><span class="line">  description: description</span><br><span class="line">  social_links:</span><br><span class="line">    - &#123; icon: icon-github, link:  https://xxx&#125;</span><br><span class="line">    # - &#123; icon: icon, link: your link &#125;</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHvJpyH1cS3tYicKdLFLuSKCdicWAZhKelmhZQdBs0Z57SuWA0bjofqiciaQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHvJpyH1cS3tYicKdLFLuSKCdicWAZhKelmhZQdBs0Z57SuWA0bjofqiciaQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<h4 id="友链"><a href="#友链" class="headerlink" title="友链"></a>友链</h4><p>友链格式按如下填写即可生成友链页面</p>
<pre class="highlight"><span class="line">links:</span><br><span class="line">  example-name-1:</span><br><span class="line">    url: https://example.com</span><br><span class="line">    avatar: https://example.com/avatar.jpg</span><br><span class="line">  example-name-2:</span><br><span class="line">    url: https://example.com</span><br><span class="line">    avatar: https://example.com/avatar.jpg</span><br></pre>

<h4 id="文章页"><a href="#文章页" class="headerlink" title="文章页"></a>文章页</h4><h5 id="搜索功能"><a href="#搜索功能" class="headerlink" title="搜索功能"></a>搜索功能</h5><pre class="highlight"><span class="line">search:</span><br><span class="line">  enable: true</span><br><span class="line">  path: search.json</span><br><span class="line">  field: posts</span><br><span class="line">  searchContent: true</span><br></pre>

<ul>
<li><code>enable</code> 开启搜索功能（默认开启）</li>
<li><code>path</code> 文件名称（暂无用处）</li>
<li><code>field</code> 需要搜索的范围，支持 posts | pages | all</li>
<li><code>searchContent</code> 搜索文件是否包含正文内容（不建议开启，包含所有文章内容这样会使得搜索文件异常巨大）替代方案是搜索分类标签或使用 algolia 等第三方搜索服务（Todo）</li>
</ul>
<h5 id="目录-1"><a href="#目录-1" class="headerlink" title="目录"></a>目录</h5><p>主题目录通过 Hexo 原生函数生成，具体可参见 <strong>文档</strong>[24]</p>
<pre class="highlight"><span class="line">toc:</span><br><span class="line">  showListNumber: false</span><br><span class="line">  maxDepth: 6</span><br><span class="line">  minDepth: 1</span><br></pre>

<p><code>showListNumber</code> 是否生成编号</p>
<p><code>maxDepth</code> TOC 最大深度</p>
<p><code>minDepth</code> TOC 最小深度</p>
<h5 id="代码高亮"><a href="#代码高亮" class="headerlink" title="代码高亮"></a>代码高亮</h5><p>参见代码 <strong>高亮文档</strong>[25]</p>
<h5 id="数学公式"><a href="#数学公式" class="headerlink" title="数学公式"></a>数学公式</h5><p>主题支持 <code>mathjax</code> 和 <code>katex</code> 两种渲染引擎，具体参见 <strong>相关文档</strong>[26]</p>
<h4 id="copyright"><a href="#copyright" class="headerlink" title="copyright"></a>copyright</h4><pre class="highlight"><span class="line">copyright:</span><br><span class="line">  enable: true</span><br><span class="line">  writer: # if writer is empty we will use config.author as writer</span><br><span class="line">  declare: 本博客所有文章除特别声明外，均采用&lt;a target=&quot;_blank&quot; rel=&quot;noopener&quot; href=&quot;https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh&quot;&gt;CC BY-NC-SA 4.0 协议&lt;/a&gt;。转载请注明出处！</span><br><span class="line">  style: warning</span><br></pre>

<p><code>enable</code> 开起版权说明（默认开启）</p>
<p><code>writer</code> 作者id，如果不填则会使用主题配置 author 或站点配置 author</p>
<p><code>declare</code> 版权声明具体内容，支持 html 语句</p>
<p><code>style</code> 声明内容样式，与 note 样式相同</p>
<p>版权内容有三部分：作者、文章链接、版权声明</p>
<p>作者使用 writer 参数，文章链接基于站点配置文件中<code>url</code>参数生成，版权声明使用 declare 参数</p>
<h4 id="Front-matter"><a href="#Front-matter" class="headerlink" title="Front-matter"></a>Front-matter</h4><h5 id="banner-img"><a href="#banner-img" class="headerlink" title="banner_img"></a>banner_img</h5><p>设置文章与首页头图</p>
<h5 id="banner-img-set"><a href="#banner-img-set" class="headerlink" title="banner_img_set"></a>banner_img_set</h5><p>在图片加载时预先加载的图片，可以设置为 loading 图或缩略图等</p>
<h5 id="excerpt"><a href="#excerpt" class="headerlink" title="excerpt"></a>excerpt</h5><p>为文章设置在首页显示的简介，还可以通过 <code>&lt;!--more--&gt;</code> 来控制显示</p>
<h4 id="评论"><a href="#评论" class="headerlink" title="评论"></a>评论</h4><p>支持 <code>valine</code>，<code>gitalk</code> 和 <code>livere</code></p>
<p>具体设置可参考主题配置文档说明和相关评论插件文档</p>
<h4 id="字数统计"><a href="#字数统计" class="headerlink" title="字数统计"></a>字数统计</h4><p>主题集成 <strong>hexo-wordcount</strong>[27] 插件，在主题配置文件中设置</p>
<pre class="highlight"><span class="line">wordcount:</span><br><span class="line">  enable: true</span><br></pre>

<p>开启（默认开启）</p>
<h4 id="图片画廊"><a href="#图片画廊" class="headerlink" title="图片画廊"></a>图片画廊</h4><p>图片画廊功能基于 <strong>fslightbox</strong>[28]，在主题配置文件中设置</p>
<pre class="highlight"><span class="line">fslightbox:</span><br><span class="line">  enable: true</span><br></pre>

<p>开启（默认开启）</p>
<h4 id="标签插件"><a href="#标签插件" class="headerlink" title="标签插件"></a>标签插件</h4><p>主题集成了一些标签方便书写</p>
<h4 id="note"><a href="#note" class="headerlink" title="note"></a>note</h4><p>在 <code>markdown</code> 文件中如下书写即可</p>
<pre class="highlight"><span class="line">&#123;% note style %&#125;</span><br><span class="line">...markdown content</span><br><span class="line">&#123;% endnote %&#125;</span><br></pre>

<p>有五种样式可以选择，<code>primary</code>，<code>success</code>，<code>info</code>，<code>warning</code>，<code>danger</code></p>
<p><img src="" alt="图片" srcset="" class="lozad post-image"></p>
<h4 id="备案信息"><a href="#备案信息" class="headerlink" title="备案信息"></a>备案信息</h4><p>你可以在主题配置文件内增加备案信息。</p>
<pre class="highlight"><span class="line">footer:</span><br><span class="line">  #------------------------</span><br><span class="line">  # 备案配置</span><br><span class="line">  # 请将公安备案的缩略图置于 $&#123;yoursite&#125;/img/beian.png</span><br><span class="line">  RecordInfo: &quot;&quot; # &#x27;某ICP备xxx号&#x27;</span><br><span class="line">  govRecordInfo: &quot;&quot; # &#x27;某公网安备xxx号&#x27;</span><br><span class="line">  govRecordUrl: &quot;&quot; # 公网安备案信息地址</span><br><span class="line">  #------------------------</span><br></pre>

<h2 id="站点托管"><a href="#站点托管" class="headerlink" title="站点托管"></a>站点托管</h2><h3 id="为什么选择-Gitee-Pages"><a href="#为什么选择-Gitee-Pages" class="headerlink" title="为什么选择 Gitee Pages"></a>为什么选择 Gitee Pages</h3><p>GitHub 和 Gitee 都提供免费的静态网页托管服务。我们可以使用 GitHub Pages 或 Gitee Pages 托管博客、项目官网等静态网页，这样就省去了购买服务器的钱，也不需要耗费太多精力维护。</p>
<p>GitHub Pages 使用很广泛，我之前也用过，不过访问不够稳定，会影响页面加载速度。Gitee 是国内版的 GitHub，访问速度优秀，并且国内发展势头不错，因此我选取 Gitee Pages 来托管我的网站。</p>
<h3 id="建立仓库"><a href="#建立仓库" class="headerlink" title="建立仓库"></a>建立仓库</h3><p>申请一个 Gitee 账号，创建一个新的仓库，仓库名尽量和账号名一致，这样可以避免一些因为路径引发的问题。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHERIXdV7z4WWXGKKzJJeszTic7jOcyBftzfrzZvhKiaLaU7jKVvJKsHqg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHERIXdV7z4WWXGKKzJJeszTic7jOcyBftzfrzZvhKiaLaU7jKVvJKsHqg/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>然后在仓库首页服务一栏开启 Gitee Pages 服务。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHUtPU3wovPzsIYt3t1iaBjVzVfU76d0HHTrBl12jic7pSFBGRJMInN7hQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHUtPU3wovPzsIYt3t1iaBjVzVfU76d0HHTrBl12jic7pSFBGRJMInN7hQ/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>开启后，你就拥有了专属的二级域名网址。</p>
<p>注意：仓库内容有变化，需要手动触发更新，页面才能真正生效。</p>
<h3 id="连接仓库"><a href="#连接仓库" class="headerlink" title="连接仓库"></a>连接仓库</h3><p>一、安装 <strong>hexo-deployer-git</strong>[29]。</p>
<pre class="highlight"><span class="line">npm install hexo-deployer-git --save</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHDqAXxtiaBAlb0Vq5ViaaWjvOXJAk8JX2xyRGaBU1kx10Jh4DgDfEAMjA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHDqAXxtiaBAlb0Vq5ViaaWjvOXJAk8JX2xyRGaBU1kx10Jh4DgDfEAMjA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>二、修改配置。</p>
<pre class="highlight"><span class="line">deploy:</span><br><span class="line">  type: git</span><br><span class="line">  repo: git@gitee.com:laoma/fungloengblog.git</span><br></pre>

<p>注意上面的 repo 地址并不是仓库的地址，而是你下载/克隆项目时弹出的那个地址，type 如果是 git 就选择 SSH。</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211221193927265.png" alt="image-20211221193927265" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211221193927265.png" class="lozad post-image"></p>
<p>三、生成/添加 SSH 公钥</p>
<p>Gitee 、GitHub 提供了基于 SSH 协议的 Git 服务，在使用 SSH 协议访问仓库仓库之前，需要先配置好账户/仓库的 SSH 公钥。</p>
<p>先看下自己有没有配置过用户名和邮箱：</p>
<pre class="highlight"><span class="line">git config --global user.name</span><br><span class="line">git config --global user.email</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHbZbn6HibEcGSwNnicb5DcVfotibGrDeodqg0GckoeN1MY7bbCzIyPmdpA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHbZbn6HibEcGSwNnicb5DcVfotibGrDeodqg0GckoeN1MY7bbCzIyPmdpA/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>如果没有就做下配置：</p>
<pre class="highlight"><span class="line"># 设置邮箱</span><br><span class="line">git config --global user.email *********@qq.com</span><br><span class="line"></span><br><span class="line"># 设置用户名</span><br><span class="line">git config --global user.name &#x27;****&#x27;</span><br></pre>

<p>然后本地生成 SSH 公钥，邮箱为刚配置好的账户：</p>
<pre class="highlight"><span class="line">ssh-keygen -t rsa -C *********@163.com</span><br></pre>

<p>生成后可查看 SSH 公钥：</p>
<pre class="highlight"><span class="line">cat ~/.ssh/id_rsa.pub</span><br></pre>

<p>复制公钥去 Gitee 粘贴，添加。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHlpw3rR6s4tpuWiaLGue8ibcT6EnYAOMwibLK4Kuibibc8RkBa4HP9dTqUsw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHlpw3rR6s4tpuWiaLGue8ibcT6EnYAOMwibLK4Kuibibc8RkBa4HP9dTqUsw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>测试是否连接成功：</p>
<pre class="highlight"><span class="line">ssh -T git@gitee.com</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHHe8ibdQLK7ldrvWFQUCB9STB1KEqz5hGk3VCDo9DZQde706GV4BDtxw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHHe8ibdQLK7ldrvWFQUCB9STB1KEqz5hGk3VCDo9DZQde706GV4BDtxw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<h3 id="上传仓库"><a href="#上传仓库" class="headerlink" title="上传仓库"></a>上传仓库</h3><p>执行部署命令，即可将本地资源上传远程仓库。</p>
<pre class="highlight"><span class="line">hexo d</span><br></pre>

<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHLvncwb8Ij3ib21QklCey9HrQK6OYlicibNGonwYyJM5mh3W1GicJ3y4H4Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHLvncwb8Ij3ib21QklCey9HrQK6OYlicibNGonwYyJM5mh3W1GicJ3y4H4Q/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<h3 id="手动更新"><a href="#手动更新" class="headerlink" title="手动更新"></a>手动更新</h3><p>远程仓库虽然可以看到提交记录，但静态网站不会感知到实时变更，需要去 Gitee Pages 服务页面做下更新。</p>
<p><img src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHuvM2g5q0zs9pgib7JHREmW4w3sNmEu7brTDaudFJeUT558IJkXSxS3w/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" alt="图片" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="https://mmbiz.qpic.cn/mmbiz_png/3jrKJ5zZic4g6xtbUOWicouDXuryNpecibHuvM2g5q0zs9pgib7JHREmW4w3sNmEu7brTDaudFJeUT558IJkXSxS3w/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1" class="lozad post-image"></p>
<p>稍等片刻，访问链接即可看到 Hexo 结合 kaze 主题搭建的静态网站。会发现无法访问js与css样式；这是由于刚才的_config.yml中的配置不对；<code>url</code>和<code>root</code>有问题导致css文件没有起作用，改正后发现还是一样，需要清除浏览器缓存后方可看到效果；</p>
<pre class="highlight"><span class="line"><span class="attr">url:</span> <span class="string">https://laoma.gitee.io/fungloengblog</span> <span class="comment">#gitee上的地址</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/fungloengblog</span> <span class="comment">#gitee仓库名</span></span><br><span class="line"></span><br></pre>



<p>如果试过上述方法后还是不行，注意一下在<code>git bash</code>里有没有清除hexo缓存<code>hexo clean</code>,生成hexo静态网页并布署<code>hexo g -d</code>,还有更新一下<code>Gitee Pages Services</code>.</p>
<pre class="highlight"><span class="line">hexo clean</span><br><span class="line">hexo g -d</span><br></pre>



<p>再次访问：</p>
<p><img src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211221200407028.png" alt="image-20211221200407028" srcset="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20300%20300'%3E%3C/svg%3E" data-src="C:\Users\laoma\AppData\Roaming\Typora\typora-user-images\image-20211221200407028.png" class="lozad post-image"></p>
<h3 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h3><p>[1]Hexo: <em><a target="_blank" rel="noopener" href="https://hexo.io/docs/">https://hexo.io/docs/</a></em>[2]git: <em><a target="_blank" rel="noopener" href="https://git-scm.com/download/win">https://git-scm.com/download/win</a></em>[3]Homebrew: <em><a target="_blank" rel="noopener" href="https://brew.sh/">https://brew.sh/</a></em>[4]官方安装程序: <em><a target="_blank" rel="noopener" href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a></em>[5]nvs: <em><a target="_blank" rel="noopener" href="https://github.com/jasongin/nvs/">https://github.com/jasongin/nvs/</a></em>[6]Homebrew: <em><a target="_blank" rel="noopener" href="https://brew.sh/">https://brew.sh/</a></em>[7]NodeSource: <em><a target="_blank" rel="noopener" href="https://github.com/nodesource/distributions">https://github.com/nodesource/distributions</a></em>[8]指南: <em><a target="_blank" rel="noopener" href="https://nodejs.org/en/download/package-manager/">https://nodejs.org/en/download/package-manager/</a></em>[9]EJS: <em><a target="_blank" rel="noopener" href="https://ejs.co/">https://ejs.co/</a></em>[10]Stylus: <em><a target="_blank" rel="noopener" href="http://learnboost.github.io/stylus/">http://learnboost.github.io/stylus/</a></em>[11]Markdown: <em><a target="_blank" rel="noopener" href="http://daringfireball.net/projects/markdown/">http://daringfireball.net/projects/markdown/</a></em>[12]时区列表: <em><a target="_blank" rel="noopener" href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">https://en.wikipedia.org/wiki/List_of_tz_database_time_zones</a></em>[13]永久链接: <em><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/permalinks">https://hexo.io/zh-cn/docs/permalinks</a></em>[14]<code>permalink</code>: <em><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/variables">https://hexo.io/zh-cn/docs/variables</a></em>[15]Asset 文件夹: <em><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/asset-folders">https://hexo.io/zh-cn/docs/asset-folders</a></em>[16]Highlight.js: <em><a target="_blank" rel="noopener" href="https://hexo.io/docs/syntax-highlight#Highlight-js">https://hexo.io/docs/syntax-highlight#Highlight-js</a></em>[17]PrismJS: <em><a target="_blank" rel="noopener" href="https://hexo.io/docs/syntax-highlight#PrismJS">https://hexo.io/docs/syntax-highlight#PrismJS</a></em>[18]Moment.js: <em><a target="_blank" rel="noopener" href="http://momentjs.com/">http://momentjs.com/</a></em>[19]<code>updated</code>: <em><a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/variables#%E9%A1%B5%E9%9D%A2%E5%8F%98%E9%87%8F">https://hexo.io/zh-cn/docs/variables#页面变量</a></em>[20]Meta generator: <em><a target="_blank" rel="noopener" href="https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta#%E5%B1%9E%E6%80%A7">https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/meta#属性</a></em>[21]kaze: <em><a target="_blank" rel="noopener" href="https://demo.theme-kaze.top/">https://demo.theme-kaze.top/</a></em>[22]谷歌文档: <em><a target="_blank" rel="noopener" href="https://analytics.google.com/">https://analytics.google.com/</a></em>[23]iconfont: <em><a target="_blank" rel="noopener" href="https://www.iconfont.cn/">https://www.iconfont.cn/</a></em>[24]文档: <em><a target="_blank" rel="noopener" href="https://hexo.io/docs/helpers#toc">https://hexo.io/docs/helpers#toc</a></em>[25]高亮文档: <em><a target="_blank" rel="noopener" href="https://demo.theme-kaze.top/highlight/">https://demo.theme-kaze.top/highlight/</a></em>[26]相关文档: <em><a target="_blank" rel="noopener" href="https://demo.theme-kaze.top/latex/">https://demo.theme-kaze.top/latex/</a></em>[27]hexo-wordcount: <em><a target="_blank" rel="noopener" href="https://github.com/willin/hexo-wordcount">https://github.com/willin/hexo-wordcount</a></em>[28]fslightbox: <em><a target="_blank" rel="noopener" href="https://fslightbox.com/">https://fslightbox.com/</a></em>[29]hexo-deployer-git: <em><a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo-deployer-git">https://github.com/hexojs/hexo-deployer-git</a></em></p>

  </div>
  <div>
    
      <div 
        class="post-note note-warning copyright" 
        style="margin-top: 42px">
        <p>
          <span style="font-weight: bold;">作者：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="/fungloengblog/about">
            IAMFUNGLOENG
          </a>
        </p>
        <p>
          <span style="font-weight: bold;">文章链接：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="https://laoma.gitee.io/fungloengblog/2021/12/21/centos7%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/">
            https://laoma.gitee.io/fungloengblog/2021/12/21/centos7%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/
          </a>
        </p>
        <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
      </div>
    
  </div>
</article>
<div class="nav">
  
  
    <div class="nav-item-next">
      <a 
        href="/fungloengblog/2021/12/21/centos7%E5%8F%96%E6%B6%88%E8%87%AA%E5%8A%A8%E4%BC%91%E7%9C%A0/" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%AE%89%E8%A3%85"><span class="toc-text">Hexo 安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%BD%AE%E8%A6%81%E6%B1%82"><span class="toc-text">前置要求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Git"><span class="toc-text">安装 Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Node-js"><span class="toc-text">安装 Node.js</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Hexo"><span class="toc-text">安装 Hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C-hexo"><span class="toc-text">运行 hexo</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%BB%BA%E7%AB%99"><span class="toc-text">Hexo 建站</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96%E6%93%8D%E4%BD%9C"><span class="toc-text">初始化操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-text">目录结构</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E5%90%AF%E5%8A%A8"><span class="toc-text">本地启动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A0%B8%E5%BF%83%E9%85%8D%E7%BD%AE"><span class="toc-text">核心配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#package-json"><span class="toc-text">package.json</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#config-yml"><span class="toc-text">_config.yml</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%BD%91%E7%AB%99"><span class="toc-text">网站</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#URL"><span class="toc-text">URL</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0"><span class="toc-text">文章</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E7%B1%BB-amp-%E6%A0%87%E7%AD%BE"><span class="toc-text">分类 &amp; 标签</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F-%E6%97%B6%E9%97%B4%E6%A0%BC%E5%BC%8F"><span class="toc-text">日期&#x2F;时间格式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E9%A1%B5"><span class="toc-text">分页</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%A9%E5%B1%95"><span class="toc-text">扩展</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4"><span class="toc-text">常用指令</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E6%96%87%E7%AB%A0"><span class="toc-text">创建文章</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-text">运行服务器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6"><span class="toc-text">生成静态文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2"><span class="toc-text">部署</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E4%B8%BB%E9%A2%98"><span class="toc-text">Hexo 主题</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Kaze"><span class="toc-text">为什么选择 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Kaze"><span class="toc-text">安装 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-text">主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%A2%9C%E8%89%B2"><span class="toc-text">主题颜色</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E5%8F%B7%E4%B8%8E%E5%AD%97%E4%BD%93"><span class="toc-text">字号与字体</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1"><span class="toc-text">站点访问量统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90"><span class="toc-text">数据分析</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5"><span class="toc-text">首页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E5%9B%BE"><span class="toc-text">文章头图</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%8F%E7%BB%84%E4%BB%B6"><span class="toc-text">小组件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B3%E4%BA%8E"><span class="toc-text">关于</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%A4%BE%E4%BA%A4%E9%93%BE%E6%8E%A5"><span class="toc-text">社交链接</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E9%A1%B5"><span class="toc-text">文章页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD"><span class="toc-text">搜索功能</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95-1"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-text">数学公式</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#copyright"><span class="toc-text">copyright</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Front-matter"><span class="toc-text">Front-matter</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img"><span class="toc-text">banner_img</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img-set"><span class="toc-text">banner_img_set</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#excerpt"><span class="toc-text">excerpt</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E6%95%B0%E7%BB%9F%E8%AE%A1"><span class="toc-text">字数统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9B%BE%E7%89%87%E7%94%BB%E5%BB%8A"><span class="toc-text">图片画廊</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%87%E7%AD%BE%E6%8F%92%E4%BB%B6"><span class="toc-text">标签插件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#note"><span class="toc-text">note</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%87%E6%A1%88%E4%BF%A1%E6%81%AF"><span class="toc-text">备案信息</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E6%89%98%E7%AE%A1"><span class="toc-text">站点托管</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Gitee-Pages"><span class="toc-text">为什么选择 Gitee Pages</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8B%E4%BB%93%E5%BA%93"><span class="toc-text">建立仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%9E%E6%8E%A5%E4%BB%93%E5%BA%93"><span class="toc-text">连接仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8A%E4%BC%A0%E4%BB%93%E5%BA%93"><span class="toc-text">上传仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E6%9B%B4%E6%96%B0"><span class="toc-text">手动更新</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-text">参考资料</span></a></li></ol></li></ol>
</div></main>
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://demo.theme-kaze.top/img/Kaze.png" 
    class="author-img"
    width="88"
    height="88"
    alt="author avatar">

<p class="author-name">IAMFUNGLOENG</p>
<p class="author-description">designed by fungloeng</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/fungloengblog/archives">
    <span>27</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/fungloengblog/categories">
    <span>8</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/fungloengblog/tags">
    <span>20</span>
    <span>标签</span>
  </a>
</div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%AE%89%E8%A3%85"><span class="toc-text">Hexo 安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%BD%AE%E8%A6%81%E6%B1%82"><span class="toc-text">前置要求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Git"><span class="toc-text">安装 Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Node-js"><span class="toc-text">安装 Node.js</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Hexo"><span class="toc-text">安装 Hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C-hexo"><span class="toc-text">运行 hexo</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%BB%BA%E7%AB%99"><span class="toc-text">Hexo 建站</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96%E6%93%8D%E4%BD%9C"><span class="toc-text">初始化操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-text">目录结构</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E5%90%AF%E5%8A%A8"><span class="toc-text">本地启动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A0%B8%E5%BF%83%E9%85%8D%E7%BD%AE"><span class="toc-text">核心配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#package-json"><span class="toc-text">package.json</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#config-yml"><span class="toc-text">_config.yml</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%BD%91%E7%AB%99"><span class="toc-text">网站</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#URL"><span class="toc-text">URL</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0"><span class="toc-text">文章</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E7%B1%BB-amp-%E6%A0%87%E7%AD%BE"><span class="toc-text">分类 &amp; 标签</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F-%E6%97%B6%E9%97%B4%E6%A0%BC%E5%BC%8F"><span class="toc-text">日期&#x2F;时间格式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E9%A1%B5"><span class="toc-text">分页</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%A9%E5%B1%95"><span class="toc-text">扩展</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4"><span class="toc-text">常用指令</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E6%96%87%E7%AB%A0"><span class="toc-text">创建文章</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-text">运行服务器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6"><span class="toc-text">生成静态文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2"><span class="toc-text">部署</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E4%B8%BB%E9%A2%98"><span class="toc-text">Hexo 主题</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Kaze"><span class="toc-text">为什么选择 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Kaze"><span class="toc-text">安装 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-text">主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%A2%9C%E8%89%B2"><span class="toc-text">主题颜色</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E5%8F%B7%E4%B8%8E%E5%AD%97%E4%BD%93"><span class="toc-text">字号与字体</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1"><span class="toc-text">站点访问量统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90"><span class="toc-text">数据分析</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5"><span class="toc-text">首页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E5%9B%BE"><span class="toc-text">文章头图</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%8F%E7%BB%84%E4%BB%B6"><span class="toc-text">小组件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B3%E4%BA%8E"><span class="toc-text">关于</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%A4%BE%E4%BA%A4%E9%93%BE%E6%8E%A5"><span class="toc-text">社交链接</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E9%A1%B5"><span class="toc-text">文章页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD"><span class="toc-text">搜索功能</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95-1"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-text">数学公式</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#copyright"><span class="toc-text">copyright</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Front-matter"><span class="toc-text">Front-matter</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img"><span class="toc-text">banner_img</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img-set"><span class="toc-text">banner_img_set</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#excerpt"><span class="toc-text">excerpt</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E6%95%B0%E7%BB%9F%E8%AE%A1"><span class="toc-text">字数统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9B%BE%E7%89%87%E7%94%BB%E5%BB%8A"><span class="toc-text">图片画廊</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%87%E7%AD%BE%E6%8F%92%E4%BB%B6"><span class="toc-text">标签插件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#note"><span class="toc-text">note</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%87%E6%A1%88%E4%BF%A1%E6%81%AF"><span class="toc-text">备案信息</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E6%89%98%E7%AE%A1"><span class="toc-text">站点托管</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Gitee-Pages"><span class="toc-text">为什么选择 Gitee Pages</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8B%E4%BB%93%E5%BA%93"><span class="toc-text">建立仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%9E%E6%8E%A5%E4%BB%93%E5%BA%93"><span class="toc-text">连接仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8A%E4%BC%A0%E4%BB%93%E5%BA%93"><span class="toc-text">上传仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E6%9B%B4%E6%96%B0"><span class="toc-text">手动更新</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-text">参考资料</span></a></li></ol></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/fungloengblog/categories/hexo/">
        <div class="categories-list-item">
          hexo
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/docker/">
        <div class="categories-list-item">
          docker
          <span class="categories-list-item-badge">2</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/docker/fastdfs/">
        <div class="categories-list-item">
          docker/fastdfs
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/docker/mysql/">
        <div class="categories-list-item">
          docker/mysql
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/idea/">
        <div class="categories-list-item">
          idea
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/idea/github/">
        <div class="categories-list-item">
          idea/github
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/win10/">
        <div class="categories-list-item">
          win10
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/fungloengblog/categories/win10/hyper-v/">
        <div class="categories-list-item">
          win10/hyper-v
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/fungloengblog/tags/ubuntu/" 
        title="ubuntu">
        <div class="tags-list-item">ubuntu</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/docker/" 
        title="docker">
        <div class="tags-list-item">docker</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/openresty/" 
        title="openresty">
        <div class="tags-list-item">openresty</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/wsl2/" 
        title="wsl2">
        <div class="tags-list-item">wsl2</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/win10/" 
        title="win10">
        <div class="tags-list-item">win10</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/lua/" 
        title="lua">
        <div class="tags-list-item">lua</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/java/" 
        title="java">
        <div class="tags-list-item">java</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/canal/" 
        title="canal">
        <div class="tags-list-item">canal</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/MySQL/" 
        title="MySQL">
        <div class="tags-list-item">MySQL</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/wsl/" 
        title="wsl">
        <div class="tags-list-item">wsl</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/port/" 
        title="port">
        <div class="tags-list-item">port</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/hyper-v/" 
        title="hyper-v">
        <div class="tags-list-item">hyper-v</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/wsl1/" 
        title="wsl1">
        <div class="tags-list-item">wsl1</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/windows10/" 
        title="windows10">
        <div class="tags-list-item">windows10</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/gui/" 
        title="gui">
        <div class="tags-list-item">gui</div>
      </a>
    
      <a 
        href="/fungloengblog/tags/nginx/" 
        title="nginx">
        <div class="tags-list-item">nginx</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%AE%89%E8%A3%85"><span class="toc-text">Hexo 安装</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%BD%AE%E8%A6%81%E6%B1%82"><span class="toc-text">前置要求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Git"><span class="toc-text">安装 Git</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Node-js"><span class="toc-text">安装 Node.js</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Hexo"><span class="toc-text">安装 Hexo</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C-hexo"><span class="toc-text">运行 hexo</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E5%BB%BA%E7%AB%99"><span class="toc-text">Hexo 建站</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96%E6%93%8D%E4%BD%9C"><span class="toc-text">初始化操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-text">目录结构</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%9C%AC%E5%9C%B0%E5%90%AF%E5%8A%A8"><span class="toc-text">本地启动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%A0%B8%E5%BF%83%E9%85%8D%E7%BD%AE"><span class="toc-text">核心配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#package-json"><span class="toc-text">package.json</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#config-yml"><span class="toc-text">_config.yml</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%BD%91%E7%AB%99"><span class="toc-text">网站</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#URL"><span class="toc-text">URL</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0"><span class="toc-text">文章</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E7%B1%BB-amp-%E6%A0%87%E7%AD%BE"><span class="toc-text">分类 &amp; 标签</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F-%E6%97%B6%E9%97%B4%E6%A0%BC%E5%BC%8F"><span class="toc-text">日期&#x2F;时间格式</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%88%86%E9%A1%B5"><span class="toc-text">分页</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%A9%E5%B1%95"><span class="toc-text">扩展</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4"><span class="toc-text">常用指令</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E6%96%87%E7%AB%A0"><span class="toc-text">创建文章</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E6%9C%8D%E5%8A%A1%E5%99%A8"><span class="toc-text">运行服务器</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%94%9F%E6%88%90%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6"><span class="toc-text">生成静态文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2"><span class="toc-text">部署</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Hexo-%E4%B8%BB%E9%A2%98"><span class="toc-text">Hexo 主题</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Kaze"><span class="toc-text">为什么选择 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AE%89%E8%A3%85-Kaze"><span class="toc-text">安装 Kaze</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="toc-text">主题配置</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%B8%BB%E9%A2%98%E9%A2%9C%E8%89%B2"><span class="toc-text">主题颜色</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E5%8F%B7%E4%B8%8E%E5%AD%97%E4%BD%93"><span class="toc-text">字号与字体</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E8%AE%BF%E9%97%AE%E9%87%8F%E7%BB%9F%E8%AE%A1"><span class="toc-text">站点访问量统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90"><span class="toc-text">数据分析</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5"><span class="toc-text">首页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E5%A4%B4%E5%9B%BE"><span class="toc-text">文章头图</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%B0%8F%E7%BB%84%E4%BB%B6"><span class="toc-text">小组件</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B3%E4%BA%8E"><span class="toc-text">关于</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%A4%BE%E4%BA%A4%E9%93%BE%E6%8E%A5"><span class="toc-text">社交链接</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%8F%8B%E9%93%BE"><span class="toc-text">友链</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%96%87%E7%AB%A0%E9%A1%B5"><span class="toc-text">文章页</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%90%9C%E7%B4%A2%E5%8A%9F%E8%83%BD"><span class="toc-text">搜索功能</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%9B%AE%E5%BD%95-1"><span class="toc-text">目录</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E4%BB%A3%E7%A0%81%E9%AB%98%E4%BA%AE"><span class="toc-text">代码高亮</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F"><span class="toc-text">数学公式</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#copyright"><span class="toc-text">copyright</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Front-matter"><span class="toc-text">Front-matter</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img"><span class="toc-text">banner_img</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#banner-img-set"><span class="toc-text">banner_img_set</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#excerpt"><span class="toc-text">excerpt</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AF%84%E8%AE%BA"><span class="toc-text">评论</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AD%97%E6%95%B0%E7%BB%9F%E8%AE%A1"><span class="toc-text">字数统计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%9B%BE%E7%89%87%E7%94%BB%E5%BB%8A"><span class="toc-text">图片画廊</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%A0%87%E7%AD%BE%E6%8F%92%E4%BB%B6"><span class="toc-text">标签插件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#note"><span class="toc-text">note</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%A4%87%E6%A1%88%E4%BF%A1%E6%81%AF"><span class="toc-text">备案信息</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%AB%99%E7%82%B9%E6%89%98%E7%AE%A1"><span class="toc-text">站点托管</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Gitee-Pages"><span class="toc-text">为什么选择 Gitee Pages</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BB%BA%E7%AB%8B%E4%BB%93%E5%BA%93"><span class="toc-text">建立仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BF%9E%E6%8E%A5%E4%BB%93%E5%BA%93"><span class="toc-text">连接仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%8A%E4%BC%A0%E4%BB%93%E5%BA%93"><span class="toc-text">上传仓库</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E6%9B%B4%E6%96%B0"><span class="toc-text">手动更新</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="toc-text">参考资料</span></a></li></ol></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-21</div>
        <a href="/fungloengblog/2021/12/21/centos7%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2/"><div class="recent-posts-item-content">centos7搭建博客</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-21</div>
        <a href="/fungloengblog/2021/12/21/centos7%E5%8F%96%E6%B6%88%E8%87%AA%E5%8A%A8%E4%BC%91%E7%9C%A0/"><div class="recent-posts-item-content"></div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-21</div>
        <a href="/fungloengblog/2021/12/21/centos7%E5%AE%89%E8%A3%85docker/"><div class="recent-posts-item-content"></div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-21</div>
        <a href="/fungloengblog/2021/12/21/docker%E5%AE%89%E8%A3%85jenkins/"><div class="recent-posts-item-content"></div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2020 -
          
          2021
        </span>
        &nbsp;
        <a 
          href="/fungloengblog/" 
          class="footer-link">
          FUNGLOENG
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
      <div class="footer-dsc">
        
          本站总访问量<span id="busuanzi_value_site_pv"></span>次
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          本站总访客数<span id="busuanzi_value_site_uv"></span>次
        
      </div>
      
    
</footer> 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton"
  aria-label="menu button"
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/fungloengblog/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/fungloengblog/js/main.js"></script> 
    
      <script> 
        loadScript('/fungloengblog/js/lib/busuanzi.min.js') 
      </script>
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/fungloengblog/js/lib/lozad.min.js', addLazyload)
      </script>
     
    
    
  </body>
</html>
